3.3.75 \(\int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx\) [275]

3.3.75.1 Optimal result
3.3.75.2 Mathematica [B] (warning: unable to verify)
3.3.75.3 Rubi [A] (verified)
3.3.75.4 Maple [F]
3.3.75.5 Fricas [F]
3.3.75.6 Sympy [F]
3.3.75.7 Maxima [F]
3.3.75.8 Giac [F]
3.3.75.9 Mupad [F(-1)]

3.3.75.1 Optimal result

Integrand size = 21, antiderivative size = 136 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}+\frac {\sqrt {2} b n \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},1-n,\frac {3}{2},\frac {1}{2} (1-\sec (c+d x)),\frac {b (1-\sec (c+d x))}{a+b}\right ) (a+b \sec (c+d x))^n \left (\frac {a+b \sec (c+d x)}{a+b}\right )^{-n} \tan (c+d x)}{(a+b) d \sqrt {1+\sec (c+d x)}} \]

output
-cot(d*x+c)*(a+b*sec(d*x+c))^n/d+b*n*AppellF1(1/2,1-n,1/2,3/2,b*(1-sec(d*x 
+c))/(a+b),1/2-1/2*sec(d*x+c))*(a+b*sec(d*x+c))^n*2^(1/2)*tan(d*x+c)/(a+b) 
/d/(((a+b*sec(d*x+c))/(a+b))^n)/(1+sec(d*x+c))^(1/2)
 
3.3.75.2 Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(3614\) vs. \(2(136)=272\).

Time = 17.33 (sec) , antiderivative size = 3614, normalized size of antiderivative = 26.57 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\text {Result too large to show} \]

input
Integrate[Csc[c + d*x]^2*(a + b*Sec[c + d*x])^n,x]
 
output
((b + a*Cos[c + d*x])^n*Cot[(c + d*x)/2]*Csc[c + d*x]^2*Sec[c + d*x]^n*(a 
+ b*Sec[c + d*x])^n*(-((AppellF1[-1/2, n, -n, 1/2, Tan[(c + d*x)/2]^2, ((a 
 - b)*Tan[(c + d*x)/2]^2)/(a + b)]*(Cos[c + d*x]*Sec[(c + d*x)/2]^2)^n)/(( 
(b + a*Cos[c + d*x])*Sec[(c + d*x)/2]^2)/(a + b))^n) + (3*(a + b)*AppellF1 
[1/2, n, -n, 3/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b) 
]*Tan[(c + d*x)/2]^2)/(3*(a + b)*AppellF1[1/2, n, -n, 3/2, Tan[(c + d*x)/2 
]^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b)] + 2*n*((-a + b)*AppellF1[3/2, n 
, 1 - n, 5/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b)] + 
(a + b)*AppellF1[3/2, 1 + n, -n, 5/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c 
+ d*x)/2]^2)/(a + b)])*Tan[(c + d*x)/2]^2)))/(2*d*(-1/4*((b + a*Cos[c + d* 
x])^n*Csc[(c + d*x)/2]^2*Sec[c + d*x]^n*(-((AppellF1[-1/2, n, -n, 1/2, Tan 
[(c + d*x)/2]^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b)]*(Cos[c + d*x]*Sec[( 
c + d*x)/2]^2)^n)/(((b + a*Cos[c + d*x])*Sec[(c + d*x)/2]^2)/(a + b))^n) + 
 (3*(a + b)*AppellF1[1/2, n, -n, 3/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c 
+ d*x)/2]^2)/(a + b)]*Tan[(c + d*x)/2]^2)/(3*(a + b)*AppellF1[1/2, n, -n, 
3/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b)] + 2*n*((-a 
+ b)*AppellF1[3/2, n, 1 - n, 5/2, Tan[(c + d*x)/2]^2, ((a - b)*Tan[(c + d* 
x)/2]^2)/(a + b)] + (a + b)*AppellF1[3/2, 1 + n, -n, 5/2, Tan[(c + d*x)/2] 
^2, ((a - b)*Tan[(c + d*x)/2]^2)/(a + b)])*Tan[(c + d*x)/2]^2))) - (a*n*(b 
 + a*Cos[c + d*x])^(-1 + n)*Cot[(c + d*x)/2]*Sec[c + d*x]^n*Sin[c + d*x...
 
3.3.75.3 Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4363, 25, 3042, 4321, 156, 155}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^n}{\cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 4363

\(\displaystyle -b n \int -\sec (c+d x) (a+b \sec (c+d x))^{n-1}dx-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle b n \int \sec (c+d x) (a+b \sec (c+d x))^{n-1}dx-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle b n \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^{n-1}dx-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

\(\Big \downarrow \) 4321

\(\displaystyle -\frac {b n \tan (c+d x) \int \frac {(a+b \sec (c+d x))^{n-1}}{\sqrt {1-\sec (c+d x)} \sqrt {\sec (c+d x)+1}}d\sec (c+d x)}{d \sqrt {1-\sec (c+d x)} \sqrt {\sec (c+d x)+1}}-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

\(\Big \downarrow \) 156

\(\displaystyle -\frac {b n \tan (c+d x) (a+b \sec (c+d x))^n \left (\frac {a+b \sec (c+d x)}{a+b}\right )^{-n} \int \frac {\left (\frac {a}{a+b}+\frac {b \sec (c+d x)}{a+b}\right )^{n-1}}{\sqrt {1-\sec (c+d x)} \sqrt {\sec (c+d x)+1}}d\sec (c+d x)}{d (a+b) \sqrt {1-\sec (c+d x)} \sqrt {\sec (c+d x)+1}}-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

\(\Big \downarrow \) 155

\(\displaystyle \frac {\sqrt {2} b n \tan (c+d x) (a+b \sec (c+d x))^n \left (\frac {a+b \sec (c+d x)}{a+b}\right )^{-n} \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},1-n,\frac {3}{2},\frac {1}{2} (1-\sec (c+d x)),\frac {b (1-\sec (c+d x))}{a+b}\right )}{d (a+b) \sqrt {\sec (c+d x)+1}}-\frac {\cot (c+d x) (a+b \sec (c+d x))^n}{d}\)

input
Int[Csc[c + d*x]^2*(a + b*Sec[c + d*x])^n,x]
 
output
-((Cot[c + d*x]*(a + b*Sec[c + d*x])^n)/d) + (Sqrt[2]*b*n*AppellF1[1/2, 1/ 
2, 1 - n, 3/2, (1 - Sec[c + d*x])/2, (b*(1 - Sec[c + d*x]))/(a + b)]*(a + 
b*Sec[c + d*x])^n*Tan[c + d*x])/((a + b)*d*Sqrt[1 + Sec[c + d*x]]*((a + b* 
Sec[c + d*x])/(a + b))^n)
 

3.3.75.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 155
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[((a + b*x)^(m + 1)/(b*(m + 1)*Simplify[b/(b*c - a*d)]^n* 
Simplify[b/(b*e - a*f)]^p))*AppellF1[m + 1, -n, -p, m + 2, (-d)*((a + b*x)/ 
(b*c - a*d)), (-f)*((a + b*x)/(b*e - a*f))], x] /; FreeQ[{a, b, c, d, e, f, 
 m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !IntegerQ[p] && GtQ[Sim 
plify[b/(b*c - a*d)], 0] && GtQ[Simplify[b/(b*e - a*f)], 0] &&  !(GtQ[Simpl 
ify[d/(d*a - c*b)], 0] && GtQ[Simplify[d/(d*e - c*f)], 0] && SimplerQ[c + d 
*x, a + b*x]) &&  !(GtQ[Simplify[f/(f*a - e*b)], 0] && GtQ[Simplify[f/(f*c 
- e*d)], 0] && SimplerQ[e + f*x, a + b*x])
 

rule 156
Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_)) 
^(p_), x_] :> Simp[(e + f*x)^FracPart[p]/(Simplify[b/(b*e - a*f)]^IntPart[p 
]*(b*((e + f*x)/(b*e - a*f)))^FracPart[p])   Int[(a + b*x)^m*(c + d*x)^n*Si 
mp[b*(e/(b*e - a*f)) + b*f*(x/(b*e - a*f)), x]^p, x], x] /; FreeQ[{a, b, c, 
 d, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !IntegerQ[p] & 
& GtQ[Simplify[b/(b*c - a*d)], 0] &&  !GtQ[Simplify[b/(b*e - a*f)], 0]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4321
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_ 
Symbol] :> Simp[Cot[e + f*x]/(f*Sqrt[1 + Csc[e + f*x]]*Sqrt[1 - Csc[e + f*x 
]])   Subst[Int[(a + b*x)^m/(Sqrt[1 + x]*Sqrt[1 - x]), x], x, Csc[e + f*x]] 
, x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b^2, 0] &&  !IntegerQ[2*m]
 

rule 4363
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)/cos[(e_.) + (f_.)*(x_)]^2, 
x_Symbol] :> Simp[Tan[e + f*x]*((a + b*Csc[e + f*x])^m/f), x] + Simp[b*m 
Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m - 1), x], x] /; FreeQ[{a, b, e, f, 
 m}, x]
 
3.3.75.4 Maple [F]

\[\int \csc \left (d x +c \right )^{2} \left (a +b \sec \left (d x +c \right )\right )^{n}d x\]

input
int(csc(d*x+c)^2*(a+b*sec(d*x+c))^n,x)
 
output
int(csc(d*x+c)^2*(a+b*sec(d*x+c))^n,x)
 
3.3.75.5 Fricas [F]

\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{2} \,d x } \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^n,x, algorithm="fricas")
 
output
integral((b*sec(d*x + c) + a)^n*csc(d*x + c)^2, x)
 
3.3.75.6 Sympy [F]

\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{n} \csc ^{2}{\left (c + d x \right )}\, dx \]

input
integrate(csc(d*x+c)**2*(a+b*sec(d*x+c))**n,x)
 
output
Integral((a + b*sec(c + d*x))**n*csc(c + d*x)**2, x)
 
3.3.75.7 Maxima [F]

\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{2} \,d x } \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^n,x, algorithm="maxima")
 
output
integrate((b*sec(d*x + c) + a)^n*csc(d*x + c)^2, x)
 
3.3.75.8 Giac [F]

\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\int { {\left (b \sec \left (d x + c\right ) + a\right )}^{n} \csc \left (d x + c\right )^{2} \,d x } \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^n,x, algorithm="giac")
 
output
integrate((b*sec(d*x + c) + a)^n*csc(d*x + c)^2, x)
 
3.3.75.9 Mupad [F(-1)]

Timed out. \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^n \, dx=\int \frac {{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^n}{{\sin \left (c+d\,x\right )}^2} \,d x \]

input
int((a + b/cos(c + d*x))^n/sin(c + d*x)^2,x)
 
output
int((a + b/cos(c + d*x))^n/sin(c + d*x)^2, x)